package net.zoneland.knowledge.service.bean;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateDeserializer;
import com.fasterxml.jackson.datatype.jsr310.deser.LocalDateTimeDeserializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateSerializer;
import com.fasterxml.jackson.datatype.jsr310.ser.LocalDateTimeSerializer;
import lombok.Data;
import net.zoneland.knowledge.utils.DateHelper;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

@Data
public class WorkReminderVo {

    /**
     * 默认分页参数.
     */
    public static final int DEFAULT_PAGE_SIZE = 10;

    /**
     * 当前页.
     */
    private Integer page;

    /**
     * 每页记录数.
     */
    private Integer pageSize;

    /**
     * 工单状态.
     */
    private String workStatus;

    /**
     * 公司名称.
     */
    private String companyName;

    /**
     * 支部orgUuid.
     */
    private String orgUuid;

    /**
     * 支部名称.
     */
    private String partyBranch;

    /**
     * 工单处理状态（待处理，接受，拒绝）
     */
    private String readType;

    /**
     * 开始时间
     */
    @DateTimeFormat(pattern = DateHelper.DATE_PATTERN)
    @JsonFormat(pattern = DateHelper.DATE_PATTERN, timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)		// 反序列化
    @JsonSerialize(using = LocalDateTimeSerializer.class)		// 序列化
    private LocalDateTime startTime;

    /**
     * 结束时间
     */
    @DateTimeFormat(pattern = DateHelper.DATE_PATTERN)
    @JsonFormat(pattern = DateHelper.DATE_PATTERN, timezone = "GMT+8")
    @JsonDeserialize(using = LocalDateTimeDeserializer.class)		// 反序列化
    @JsonSerialize(using = LocalDateTimeSerializer.class)
    private LocalDateTime endTime;

    /**
     * 完成状态列表
     */
    private String finishStatus;

    /**
     * 导出类型（省公司、直属党委、市公司、支部）
     */
    private String exportType;
}
